<script setup lang='ts'>
import { ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter()
const { title, color, text, mydata } = defineProps<{
    title: string,
    color: string,
    text: string,
    mydata: any[] | undefined
}>()
const routerThisData = (e: string) => {
    router.push({ name: 'thisData', query: { title: '业务预览', id: e } })
}
</script>

<template>
    <div class="i"></div>
    <div class="content">
        <div class="title" :style="{ backgroundColor: color }">
            <div class="icon">
                <slot></slot>
            </div>
            <h3>{{ title }}</h3>
            <p class="text">{{ text }}</p>
        </div>
        <div class="data">
            <el-empty style="width: 1170px;" v-if="mydata?.length !== 0 ? false : true" description="没数据" />
            <div class="data-content" v-for="i in mydata" :key="i._id"
                @click="routerThisData(i._id)">
                <div class="myData">
                    <div class="titleData">
                        <div class="moneyAndA">
                            <p class="money">￥{{ i.money }}</p>
                            <a href="javascript:;">{{ i.title }}</a>
                        </div>
                        <div class="imgName">
                            <img src="https://iu.huzhan.com/sign/1475925035869.jpg" alt="">
                            <p class="name">{{i.userName}}</p>
                        </div>
                    </div>
                    <div class="textData">
                        <p>{{ i.text }} </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<style scoped>
@import url(../../assets/style/content.css);
</style>